<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Test loading a local HTML Document</title>
    <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
    <script type="text/javascript" src="../app/jsUnitCore.js"></script>
    <script type="text/javascript">
        function testSimpleSuite() {
            var suite = new jsUnitTestSuite();
            suite.addTestPage("/path/to/page1.html");
            suite.addTestPage("/path/to/page2.html");
            suite.addTestPage("/path/to/page3.html");

            assertTrue(suite.containsTestPages());
            assertEquals("/path/to/page1.html", suite.nextPage());
            assertEquals("/path/to/page2.html", suite.nextPage());
            assertEquals("/path/to/page3.html", suite.nextPage());
        }

        function testSuiteWithSubsuites() {
            var subsuite = new jsUnitTestSuite();
            subsuite.addTestPage("/path/to/page2.html");
            subsuite.addTestPage("/path/to/page3.html");
            subsuite.addTestPage("/path/to/page4.html");

            var suite = new jsUnitTestSuite();
            suite.addTestPage("/path/to/page1.html");
            suite.addTestSuite(subsuite);
            suite.addTestPage("/path/to/page5.html");

            assertTrue(suite.containsTestPages());
            assertEquals("/path/to/page1.html", suite.nextPage());
            assertEquals("/path/to/page2.html", suite.nextPage());
            assertEquals("/path/to/page3.html", suite.nextPage());
            assertEquals("/path/to/page4.html", suite.nextPage());
            assertEquals("/path/to/page5.html", suite.nextPage());
        }

        function testSpecifyTestsInConstructor() {
            var subsuite = new jsUnitTestSuite(
                "/path/to/page2.html",
                "/path/to/page3.html",
                "/path/to/page4.html"
            );

            var suite = new jsUnitTestSuite(
                "/path/to/page1.html",
                subsuite,
                "/path/to/page5.html"
            );

            assertTrue(suite.containsTestPages());
            assertEquals("/path/to/page1.html", suite.nextPage());
            assertEquals("/path/to/page2.html", suite.nextPage());
            assertEquals("/path/to/page3.html", suite.nextPage());
            assertEquals("/path/to/page4.html", suite.nextPage());
            assertEquals("/path/to/page5.html", suite.nextPage());
        }

    </script>
</head>

<body>
<h1>JsUnit test suite tests</h1>
</body>
</html>
